package demo;

public class AccessPersonConstructors {
    public static void main(String[] args) {
        //测试反射构造方法
        try {
            Class  clz=Class.forName("demo.Person");
            Object obj=clz.newInstance();//new新建 Instance实例
            System.out.println(obj);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }
}
